package com.geekband.Test01;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import android.widget.Toast;

/**
 * Function: 接收广播
 * Create date on 15/11/25.
 *
 * @author Conquer
 * @version 1.0
 */
public class TestBroadcastReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        //  receive broadcast, handle data

        // > 10S ANR work thread
        if (intent != null) {
            if (TextUtils.equals(intent.getAction(), SendBroadcastActivity.COM_GEEKBAND_TEST_BROADCAST)) {
                String toastString = intent.getStringExtra("toast");
                Toast.makeText(context, toastString, Toast.LENGTH_LONG).show();
            }
        }
    }
}
